package com.ruyuan.seckilling.purchase.request;

import lombok.Getter;
import lombok.Setter;

import java.util.Objects;

/**
 * @author zhonghuashishan
 */
@Getter
@Setter
public class PurchaseRequest {

    private Long activityId;

    private Long skuId;

    private Long userId;

    public String validateParams() {
        if (Objects.isNull(activityId) || activityId <= 0
                || Objects.isNull(skuId) || skuId <= 0
                || Objects.isNull(userId) || userId <= 0) {
            return "参数不合法";
        }
        return null;
    }

}
